package com.jky.stmall.manger;

import java.util.Scanner;

public class T {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String s= scanner.next();
        System.out.println(function(s));

    }
    public static int function(String s){
        if (s.length()==0||s==null){
            return -1;
        }
        if (s.length()==1){
            return 1;
        }
        int max=0;
        int t=1;
        for (int i =1;i<s.length();i++){
            char pre=s.charAt(i-1);
            char now=s.charAt(i);
            if (now-pre==1){
                t++;
            }else {
                max=(max>t?max:t);
                t=1;
            }


        }
        max=(max>t?max:t);
        return max;
    }
}
